package com.xtaller.lazy.service.base; 

import com.xtaller.lazy.base.TServiceImpl; 
import com.xtaller.lazy.mapper.base.UserRoleMapper; 
import com.xtaller.lazy.model.base.UserRole; 
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/** 
* 代码生成 
* @author: Taller  
* @date: 2019/04/11
* @Description: 用户角色关联表服务 
*/ 
@Service 
public class UserRoleService extends TServiceImpl<UserRoleMapper, UserRole>{

    @Transactional(rollbackFor = Exception.class)
    public boolean setRole(List<UserRole> urs, Long userId){
        baseMapper.init(userId);
        return this.saveBatch(urs, urs.size());
    }

    public Boolean init(Long userId){
        return baseMapper.init(userId);
    }


}
